import { createRouter, createWebHashHistory } from 'vue-router';
import type { RouteRecordRaw } from 'vue-router';
// 导入进度条
// import NProgress from "nprogress";
// import "nprogress/nprogress.css";
// import Home from "@/views/home/index.vue";
import Draw from '@/views/draw/index.vue';
import { createDiscreteApi } from 'naive-ui';
const { loadingBar } = createDiscreteApi(['loadingBar']);
const routes: RouteRecordRaw[] = [
  {
    path: '/',
    name: 'Root',
    component: Draw,
    meta: { transition: 'slide-right' }
  },
  {
    path: '/dall',
    name: 'dall',
    component: () => import('@/views/dallE3/index.vue'),
    meta: { transition: 'slide-right' }
  },
  {
    path: '/sora',
    name: 'sora',
    component: () => import('@/views/sora/soraIndex.vue'),
    meta: { transition: 'slide-right' }
  }
];
export const router = createRouter({
  routes,
  history: createWebHashHistory()
});

router.beforeEach(() => {
  loadingBar.start();
});
router.afterEach(() => {
  loadingBar.finish();
});
